package com.woniuxy.store.core.controller;


import com.woniuxy.common.CommonResult;
import com.woniuxy.store.core.model.MdStoreUser;
import com.woniuxy.store.core.service.MdStoreUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gmx
 * @since 2021-07-06
 */
@RestController
@RequestMapping("/mdStoreUser")
@Api(tags = "店家登录接口")
public class MdStoreUserController {

    @Resource
    MdStoreUserService mdStoreUserService;

    @PostMapping("/login")
    @ApiOperation("店家登陆(门店端接口)")
    public CommonResult login(@RequestBody MdStoreUser mdStoreUser){
        MdStoreUser mdStoreUser1 = this.mdStoreUserService.subLogin(mdStoreUser);
        if (mdStoreUser1 == null){
            return CommonResult.fail("登陆失败");
        }
        return CommonResult.success(mdStoreUser1);

    }

}

